package com.woniuxy.purchasemanager.controller;

import com.woniuxy.entity.purchaseManager.Need;
import com.woniuxy.entity.purchaseManager.utils.R;
import com.woniuxy.purchasemanager.service.NeedService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Author:黄志超
 * @Todo:TODO
 * @DateTime:2022/4/18 22:40
 * @Component:蜗牛
 **/
@Api(tags = "添加采购需求单")
@RestController
@RequestMapping("/purchasemanager/need")
public class NeedController {
    @Resource
    private NeedService needService;

    @ApiOperation(value = "新建提交需求")
    @PostMapping("/add")
    public R insert(@PathVariable Need need){
        boolean save = needService.save(need);
        return  R.ok();
    }
}
